//粉丝列表关注与取消关注
function followfans(userid,authorid,thzs){
		var that = $(thzs);
		that.attr("disabled",true);
		 var state = that.data('state');
	     if(state == 1 || state == 2){
	    	 layer.open({
	 	        content: '是否取消关注?',
	 	        btn: ['确定', '取消'],
	 	        shadeClose: false,
	 	        yes: function (index) {
	 	        	$.ajax({ 
	 	  			 url: '/operate/'+ userid + '/cancel/' + authorid, 
	 	  			 type: "POST",
	 	  	         data: {},
	 	  	         dataType: "json",//请求数据类型
	 	  			 success: function(data){
	 	  				 if(data.code == 0){
	 	  					 layer.close(index);
	 	  				     that.text("关注")
	 	  				     that.data("state",0);
	 	  				     that.removeClass('Summary-liInfo-rfActive');
	 	  				 }else{
	 	  					sstb.dialog(data.msg);
	 	  				 }
	 	  				that.attr("disabled",false);
	 	  			 },
	 	  			 error : function() {
	 	  				sstb.dialog("取消关注异常");
	 	  				that.attr("disabled",false);
	 	  			 }
	 	  		 })
	 	        },
	 	        no: function () {
	 	        	that.attr("disabled",false);
	 	        }
	 	    });
	     }else{
	    	 $.ajax({ 
	    		 url: '/operate/'+ userid + '/follow/' + authorid, 
	    		 type: "POST",
	            data: {},
	            dataType: "json",//请求数据类型
	    		 success: function(data){
	    			 var result = data.data;
	    			 if(data.code == 0){
	    				if(result == 1){
	    			        that.text("已关注")
	    				 }else if(result == 2){
	    				    that.text("互为关注")
	    				 }
	    				that.addClass('Summary-liInfo-rfActive');
	    				that.data("state",result);
	    			 }else{
	    				 sstb.dialog(data.msg);
	    			 }
	    			 that.attr("disabled",false);
	    		 },
	    		 error : function() {
	    			 sstb.dialog("关注失败");
	    			 that.attr("disabled",false);
	    		 }
	    	 })
	     }
}
	 

